package com.java1234.view;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class MainFrm extends JFrame {

	private JPanel contentPane;
	private JDesktopPane table = null;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainFrm frame = new MainFrm();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainFrm() {
		setTitle("系统管理主界面");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);

		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);

		JMenu mnNewMenu = new JMenu("图书管理维护");
		menuBar.add(mnNewMenu);

		JMenu mnNewMenu_2 = new JMenu("图书类别管理");
		mnNewMenu.add(mnNewMenu_2);

		JMenuItem mntmNewMenuItem_2 = new JMenuItem("图书类别添加");
		mntmNewMenuItem_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BookTypeAddInterFrm bookTypeAddInterFrm = new BookTypeAddInterFrm();
				bookTypeAddInterFrm.setVisible(true);
				table.add(bookTypeAddInterFrm);
			}
		});
		mnNewMenu_2.add(mntmNewMenuItem_2);

		JMenuItem mntmNewMenuItem_3 = new JMenuItem("图书类别维护");
		mntmNewMenuItem_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BookTypeManageInterFrm bookTypeManageInterFrm = new BookTypeManageInterFrm();
				bookTypeManageInterFrm.setVisible(true);
				table.add(bookTypeManageInterFrm);
			}
		});
		mnNewMenu_2.add(mntmNewMenuItem_3);

		JMenu mnNewMenu_3 = new JMenu("图书管理");
		mnNewMenu.add(mnNewMenu_3);

		JMenuItem mntmNewMenuItem_4 = new JMenuItem("图书添加");
		mntmNewMenuItem_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BookAddInterFrm bookAddInterFrm = new BookAddInterFrm();
				bookAddInterFrm.setVisible(true);
				table.add(bookAddInterFrm);
			}
		});
		mnNewMenu_3.add(mntmNewMenuItem_4);

		JMenuItem mntmNewMenuItem_5 = new JMenuItem("图书维护");
		mntmNewMenuItem_5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BookManageInterFrm bookManageInterFrm = new BookManageInterFrm();
				bookManageInterFrm.setVisible(true);
				table.add(bookManageInterFrm);
			}
		});
		mnNewMenu_3.add(mntmNewMenuItem_5);

		JMenuItem mntmNewMenuItem = new JMenuItem("安全退出");
		mntmNewMenuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int result = JOptionPane.showConfirmDialog(null, "是否退出系统");
				if (result == 0) {
					dispose();
				}
			}
		});
		mnNewMenu.add(mntmNewMenuItem);

		JMenu mnNewMenu_1 = new JMenu("关于我们");
		menuBar.add(mnNewMenu_1);

		JMenuItem mntmNewMenuItem_1 = new JMenuItem("关于本系统设计");
		mntmNewMenuItem_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Java1234InterFrm java1234InterFrm = new Java1234InterFrm();
				java1234InterFrm.setVisible(true);
				table.add(java1234InterFrm);
			}
		});
		mnNewMenu_1.add(mntmNewMenuItem_1);

		JMenu mnNewMenu_4 = new JMenu("用户信息");
		mnNewMenu_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {// 用户信息
				Java1234InterFrm java1234InterFrm = new Java1234InterFrm();
				java1234InterFrm.setVisible(true);
				table.add(java1234InterFrm);
			}
		});
		menuBar.add(mnNewMenu_4);

		JMenu mnNewMenu_5 = new JMenu("借阅者信息管理");
		mnNewMenu_4.add(mnNewMenu_5);

		JMenuItem mntmNewMenuItem_6 = new JMenuItem("借阅者信息添加");
		mntmNewMenuItem_6.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BorrowerAddInterFrm borrowerAddInterFrm = new BorrowerAddInterFrm();
				borrowerAddInterFrm.setVisible(true);
				table.add(borrowerAddInterFrm);
			}
		});
		mnNewMenu_5.add(mntmNewMenuItem_6);

		JMenuItem mntmNewMenuItem_7 = new JMenuItem("借阅者信息维护");
		mntmNewMenuItem_7.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BorrowerManagerInterFrm borrowerManagerInterFrm = new BorrowerManagerInterFrm();
				borrowerManagerInterFrm.setVisible(true);
				table.add(borrowerManagerInterFrm);
			}
		});
		mnNewMenu_5.add(mntmNewMenuItem_7);

		JMenu mnNewMenu_7 = new JMenu("图书管理员信息管理");
		mnNewMenu_4.add(mnNewMenu_7);

		JMenuItem mntmNewMenuItem_10 = new JMenuItem("图书管理员信息添加");
		mntmNewMenuItem_10.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				LibrarianAddInterFrm liberarianAddInterFrm = new LibrarianAddInterFrm();
				liberarianAddInterFrm.setVisible(true);
				table.add(liberarianAddInterFrm);
			}
		});
		mnNewMenu_7.add(mntmNewMenuItem_10);

		JMenuItem mntmNewMenuItem_11 = new JMenuItem("图书管理员信息维护");
		mntmNewMenuItem_11.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				LibrarianManageInterFrm librarianManageInterFrm = new LibrarianManageInterFrm();
				librarianManageInterFrm.setVisible(true);
				table.add(librarianManageInterFrm);
			}
		});
		mnNewMenu_7.add(mntmNewMenuItem_11);

		JMenu mnNewMenu_8 = new JMenu("系统管理员信息管理");
		mnNewMenu_4.add(mnNewMenu_8);

		JMenuItem mntmNewMenuItem_12 = new JMenuItem("系统管理员添加");
		mntmNewMenuItem_12.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				SystemAdministratorAddInterFrm systemAdministratorAddInterFrm = new SystemAdministratorAddInterFrm();
				systemAdministratorAddInterFrm.setVisible(true);
				table.add(systemAdministratorAddInterFrm);
			}
		});
		mnNewMenu_8.add(mntmNewMenuItem_12);

		JMenuItem mntmNewMenuItem_13 = new JMenuItem("系统管理员维护");
		mntmNewMenuItem_13.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				SystemAdministratorManageInterFrm systemAdministratorManageInterFrm = new SystemAdministratorManageInterFrm();
				systemAdministratorManageInterFrm.setVisible(true);
				table.add(systemAdministratorManageInterFrm);
			}
		});
		mnNewMenu_8.add(mntmNewMenuItem_13);

		JMenu mnNewMenu_6 = new JMenu("图书借阅");
		menuBar.add(mnNewMenu_6);

		JMenuItem mntmNewMenuItem_8 = new JMenuItem("图书查询");
		mntmNewMenuItem_8.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BookBorrowManageInterFrm bookBorrowManageInterFrm = new BookBorrowManageInterFrm();
				bookBorrowManageInterFrm.setVisible(true);
				table.add(bookBorrowManageInterFrm);
			}
		});
		mnNewMenu_6.add(mntmNewMenuItem_8);

		JMenuItem mntmNewMenuItem_9 = new JMenuItem("借阅信息");
		mntmNewMenuItem_9.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				BookReturnManageInterFrm bookReturnManageInterFrm = new BookReturnManageInterFrm();
				bookReturnManageInterFrm.setVisible(true);
				table.add(bookReturnManageInterFrm);
			}
		});
		mnNewMenu_6.add(mntmNewMenuItem_9);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new BorderLayout(0, 0));

		table = new JDesktopPane();
		contentPane.add(table, BorderLayout.CENTER);
		// 设置JFrame最大化
		this.setExtendedState(JFrame.MAXIMIZED_BOTH);

	}
}
